﻿using AiMachineControl.Model;

namespace AiMachineControl.IService
{
    public interface IFileService
    {
        /// <summary>
        /// 通过文件流上传文件方法
        /// </summary>
        /// <param name="byteData">文件字节数组</param>
        /// <param name="savePath">本地上传目录相对路径</param>
        /// <param name="fileName">文件名</param>
        Task<FileDto> SaveAsync(byte[] byteData, string savePath, string fileName);

        /// <summary>
        /// 保存远程文件到本地
        /// </summary>
        /// <param name="sourceUri">URI地址</param>
        /// <param name="savePath">上传后的路径地址</param>
        /// <returns>上传后的文件</returns>
        Task<FileDto> RemoteAsync(string sourceUri, string savePath);

        /// <summary>
        /// 下载并保存
        /// </summary>
        /// <param name="url">网络路径</param>
        /// <param name="savePath">保存本地的文件夹</param>
        /// <param name="fileName">保存的新文件名</param>
        string FileDownSave(string url, string savePath,string fileName);
    }
}
